home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / scripts.arc / FKEY.SLT < prev    next >
Text File  |  1988-11-07  |  4KB  |  175 lines

  1. /////////////////////////////////////////////////////////////////////////
  2. //            FKEY.SLT  -  by Terry Robertson (October 1988)           //
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
  4. //                                                                     //
  5. //  This script will set up the function keys as described in the      //
  6. //  T3SCRIPT.DOC file. Please bear in mind that the script assumes     //
  7. //  that if you already have a TELIX.KEY file in which you have saved  //
  8. //  some key assignments of your own, you DO wish to overwrite that    //
  9. //  file. If this is not the case, either type in the new function     //
  10. //  key assignments as explained in the .DOC file or, rename your old  //
  11. //  TELIX.KEY file so that you still have it available for future use  //
  12. //  if required.                                                       //
  13. //                                                                     //
  14. //  The revised TELIX.KEY file will be loaded automatically and the    //
  15. //  function keys will work as advertised!                             //
  16. //                                                                     //
  17. /////////////////////////////////////////////////////////////////////////
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. str pass1[20];
  27. str pass2[20];
  28.  
  29. str F1[40]    = "15104=^"";
  30. str F2[40]    = "15360=^"";
  31. str F3[17]    = "15616=^"@password^"";
  32. str F4[60]    = "15872=^"";
  33. str F5[16]    = "16128=^"@connect^"";
  34. str F6[16]    = "16384=^"@bbnotes^"";
  35. str F7[13]    = "16640=^"@help^"";
  36. str F8[14]    = "16896=^"@time^"";
  37. str F9[11]    = "17152=^"@on^"";
  38. str F10[12]   = "17408=^"@off^"";
  39.  
  40.  
  41. str head[]    = "FKEY - Function Key Configuration Script";
  42. str aye[]     = "A: Enter My FIRST Name ";
  43. str bee[]     = "B: Enter My LAST Name ";
  44. str exe[]     = "X: Exit without saving changes ";
  45. str ess[]     = "S: Exit and save changes to disk ";
  46. str whch[]    = "Which option? ";
  47. str fst[]     = "What is your FIRST name? ";
  48. str lst[]     = "What is your LAST name?  ";
  49.  
  50. int flag1;
  51.  
  52. //////////////////////////////////////////////////////////////////////////////
  53.  
  54. main()
  55.  
  56. {
  57.  
  58.  key_configure();
  59.  
  60. }
  61.  
  62. //////////////////////////////////////////////////////////////////////////////
  63.  
  64.  
  65. key_configure()
  66.  
  67. {
  68.  str s[100];
  69.  int c, f, i, stat;
  70.  
  71.  
  72.  while (1)
  73.   {
  74.    clear_scr();
  75.    box(0, 0, 60, 10, 2, 0, 30);
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.    pstraxy(head, 3 ,1, 31);
  83.    pstraxy(aye, 3, 3, 31);
  84.    pstraxy(bee, 3, 4, 31);
  85.    pstraxy(exe, 3, 5, 31);
  86.    pstraxy(ess, 3, 6, 31);
  87.    pstraxy(whch, 3, 8, 31);
  88.    getsxy(s, 1, 17, 8, 31);
  89.    pstra("");
  90.    c = toupper(subchr(s, 0));
  91.    if (c < 'A' || c > 'X')
  92.     continue;
  93.  
  94. //   if (c >= 'A' && c <= 'B')
  95. //    pstraxy(new, 3, 8, 31);
  96.  
  97.    if (c == 'A')
  98.     {
  99.      flag1=1;
  100.      pstraxy(fst, 3, 8, 31);
  101.      stat = getsxy(s, 15, 28, 8, 31);
  102.      if (stat != -1)
  103.       pass1 = s;
  104.     }
  105.    else if (c == 'B')
  106.     {
  107.      flag1=1;
  108.      pstraxy(lst, 3, 8, 31);
  109.      stat = getsxy(s, 20, 28, 8, 31);
  110.      if (stat != -1)
  111.       pass2 = s;
  112.     }
  113.    else if (c == 'X')
  114.    {
  115. abort:
  116.      clear_scr();
  117.      return;
  118.     }
  119.    else if (c == 'S')
  120.     {
  121.      if(flag1 < 1) goto abort;
  122.      s = _telix_dir;
  123.      strcat(s, "TELIX.KEY");
  124.      f = fopen(s, "w");
  125.  
  126.      if (!f)
  127.       {
  128.        printsc("Error writing to ");
  129.        printsc(s);
  130.        prints("!");
  131.        continue;
  132.       }
  133.  
  134.      strcat(F1, pass1);
  135.      strcat(F1, "^^M");
  136.      strcat(F1, "^"");
  137.      fputs(F1, f);
  138.      fputs("^M^J", f);
  139.      strcat(F2, pass2);
  140.      strcat(F2, "^^M");
  141.      strcat(F2, "^"");
  142.      fputs(F2, f);
  143.      fputs("^M^J", f);
  144.      fputs(F3, f);
  145.      fputs("^M^J", f);
  146.      strcat(F4, pass1);
  147.      strcat(F4, " ");
  148.      strcat(F4, pass2);
  149.      strcat(F4, "^^M");
  150.      strcat(F4, "^"");
  151.      fputs(F4, f);
  152.      fputs("^M^J", f);
  153.      fputs(F5, f);
  154.      fputs("^M^J", f);
  155.      fputs(F6, f);
  156.      fputs("^M^J", f);
  157.      fputs(F7, f);
  158.      fputs("^M^J", f);
  159.      fputs(F8, f);
  160.      fputs("^M^J", f);
  161.      fputs(F9, f);
  162.      fputs("^M^J", f);
  163.      fputs(F10, f);
  164.      fputs("^M^J", f);
  165.  
  166.      clear_scr();
  167.      fclose(f);
  168.  
  169.      keyload("telix.key");
  170.  
  171.      return;
  172.     }
  173.   }
  174. }
  175.